package com.hengpeng.itfints.service.article;

import java.util.Date;
import java.util.List;

import com.hengpeng.common.exception.ServiceResult;
import com.hengpeng.common.persist.QueryResult;
import com.hengpeng.itfinbase.en.ArticleGroupType;
import com.hengpeng.itfinbase.persist.Article;
import com.hengpeng.itfinbase.persist.ArticleCategory;
import com.hengpeng.itfinbase.persist.ArticleGroup;

public interface ArticleService {

    /**
     * <pre>
     * 根据类型查询
     * </pre>
     * 
     * @param categoryId
     * @param count
     * @param currentPage
     * @return
     */
    public QueryResult<Article> findArticleByCategoryId(Long categoryId, Integer count, Integer currentPage);

    public List<Article> findArticleListByGroupId(Long groupId, Integer count);

    public Article getArticle(Long articleId);

    public QueryResult<Article> findArticleListByGroup(ArticleGroupType gid, Integer pageSize, Integer currentPage);

    public List<ArticleCategory> findArticleCategoryAll();

    public ServiceResult<List<Article>> queryList(Integer pageIndex, Integer pageSize);

    /**
     * 获得上一条新闻
     * 
     * @param articleId
     * @param groupId
     * @return
     */
    public Article getPrevArticle(Date publishTime, ArticleGroupType type);

    /**
     * 获得下一条新闻
     * 
     * @param articleId
     * @param groupId
     * @return
     */
    public Article getNextArticle(Date publishTime, ArticleGroupType type);

    /**
     * 根据类型获得分组
     * 
     * @param type
     * @return
     */
    public ArticleGroup getArticleByGroupType(ArticleGroupType type);

    /**
     * 平台常见问题解释
     * 
     * @return
     */
    public Article getArticleLike();
}
